package com.ybu.controller;

import com.mysql.cj.x.protobuf.Mysqlx;
import com.ybu.common.R;
import com.ybu.pojo.vo.ProductVO;
import com.ybu.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("api/product")
public class ProductController {
    @Autowired
    private ProductService productService;

    @GetMapping("newList")
    public R<List<ProductVO>> getNewProductList(){
        List<ProductVO> newProductList = productService.getNewProductList();
        return R.ok(newProductList);
    }
}
